const Goods = {
    price:10,
    num:100,
    total:1000
}

class UIGoods {
    constructor(){
        let internalChooseValue = 0
        Object.defineProperty(this,'choose',{
            configurable:false,
            get: function (){
                return internalChooseValue
            },
            set: function(val){
                internalChooseValue = val
            }
        })
    }
}

const g = new UIGoods(Goods)
g.choose = 10
console.log(g.choose)